package com.kfm.pm.movie;

import java.util.concurrent.CountDownLatch;

public class MovieTest {

    public static void main(String[] args) {
        MovieTheater movieTheater = new MovieTheater();
        CountDownLatch latch = new CountDownLatch(10);
        for (int i = 0; i < 10; i++) {
            new Thread(() -> {
                movieTheater.sell();
                latch.countDown();
            }).start();
        }
        try {
            latch.await();
            System.out.println("main end");
        } catch (InterruptedException e) {
            throw new RuntimeException(e);
        }

    }
}
